#!/usr/bin/env python
# -*- coding: utf-8 -*-

import csv

class PCsv:
	def __init__(self):
	
		pass
		
	def firstQuery(self, listValues, result, establishment, year):
		
		spamWriter = csv.writer(open('query1.csv', 'wb'), delimiter=',')

		spamWriter.writerow(['Teacher', 'Establishment', 'Year', 'Result'])
				
		controlValue = 0
		
		for row in listValues:
			if controlValue == 0:
				
				spamWriter.writerow([row, establishment, year,result ])
				controlValue = 1
			else:
				spamWriter.writerow([row])
				pass
			pass
				
		
	def secondQuery(self, listValues, result, establishment,categorie,year):
		
		spamWriter = csv.writer(open('query2.csv', 'wb'), delimiter=',')

		spamWriter.writerow(['Teacher', 'Establishment', 'Year', 'Categorie','Result'])
				
		controlValue = 0
		
		for row in listValues:
			if controlValue == 0:
				
				spamWriter.writerow([row, establishment, year,categorie, result])
				controlValue = 1
			else:
				spamWriter.writerow([row])
				pass
			pass
	
	def thirdQuery(self, listValues, result, establishment,degree,year):
		
		spamWriter = csv.writer(open('query3.csv', 'wb'), delimiter=',')

		spamWriter.writerow(['Teacher', 'Establishment', 'Year', 'Degree','Result'])
				
		controlValue = 0
		
		for row in listValues:
			if controlValue == 0:
				
				spamWriter.writerow([row, establishment, year,degree, result])
				controlValue = 1
			else:
				spamWriter.writerow([row])
				pass
			pass
			
		
		
